package tag17_01_08.listener;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

class MyActionListener implements ActionListener{
	public void actionPerformed(ActionEvent e){
		System.out.println("test actionPerformed");
	}
}


public class Thema4_ListenerFuerButton {

	public static void main(String[] args) {
		
		JFrame frame = new JFrame();
		
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		frame.setBounds(100, 200, 300, 150);
		
		JButton button = new JButton("Click");
		
		ActionListener listener = new MyActionListener(); 
		button.addActionListener(listener);
		
		frame.add(button, BorderLayout.SOUTH);
		
		
		frame.setVisible(true);
		
	}

}
